package edu.um.analyzer.exception;

import edu.um.expression.Expression;
import edu.um.token.Token;

public class VariableNotDeclaredException extends Exception {
  /**
   *
   */
  private static final long serialVersionUID = 1L;

  public VariableNotDeclaredException(Token token) {
    super(String.format("The variable %s at %d : %d has not been declared",
        token.getValue(), token.getLine(), token.getColumn()));
  }

  public VariableNotDeclaredException(Expression expression) {
    super(String.format("The variable %s at %d : %d has not been declared",
        expression.toString(), expression.get(0).getLine(), expression.get(0)
            .getColumn()));
  }

}
